home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / sun / volume1 / contool2.1 < prev    next >
Encoding:
Internet Message Format  |  1989-06-21  |  58.3 KB

  1. Path: uunet!lll-winken!csd4.milw.wisc.edu!cs.utexas.edu!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew
  2. From: mcgrew@dartagnan.rutgers.edu (Charles Mcgrew)
  3. Newsgroups: comp.sources.sun
  4. Subject: v01i034:  contool - A new Sunview console message handler
  5. Message-ID: <Jun.21.13.51.25.1989.29050@dartagnan.rutgers.edu>
  6. Date: 21 Jun 89 17:51:28 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 1641
  9. Approved: mcgrew@aramis.rutgers.edu
  10.  
  11. Submitted-by: chuck@melmac.harris-atd.com
  12. Posting-number: Volume 1, Issue 34
  13. Archive-name: contool2.1
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of shell archive."
  22. # Contents:  Makefile README contool.c contool.man misc.c sample.filter
  23. #   icons icons/console1.icon icons/console1_bad.icon
  24. #   icons/console1_flash.icon icons/contool.icon
  25. #   icons/contool_bad.icon icons/stopsign.icon icons/stopsign_inv.icon
  26. # Wrapped by chuck@melmac on Fri Feb 10 11:25:37 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'Makefile'\"
  30. else
  31. echo shar: Extracting \"'Makefile'\" \(702 characters\)
  32. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  33. XBIN    = /usr/local/bin
  34. X
  35. XMAN    = /usr/man/manl
  36. XMANEXT    = l
  37. X
  38. X# directory where icons can be found, must end with '/'!
  39. XICON_DIR = ./icons/
  40. X
  41. XOFILES    = contool.o misc.o
  42. X
  43. X.c.o:
  44. X    cc -O -c -DICON_DIRECTORY=\"$(ICON_DIR)\" $<
  45. X
  46. Xcontool: $(OFILES)
  47. X    cc -o contool $(OFILES) -lsuntool -lsunwindow -lpixrect
  48. X
  49. Xinstall: contool $(MAN)/contool.$(MANEXT)
  50. X    cp contool $(BIN)
  51. X    chmod 755 $(BIN)/contool
  52. X
  53. X$(MAN)/contool.$(MANEXT): contool.man
  54. X    cp -p contool.man $(MAN)/contool.$(MANEXT)
  55. X
  56. Xinstall-icons: 
  57. X    for i in icons/*.icon; do \
  58. X        cp $$i $(ICON_DIR); \
  59. X    done;
  60. X
  61. Xclean:
  62. X    rm -f *~ $(OFILES) contool core
  63. X
  64. Xshar:
  65. X    rm -f contool.shar
  66. X    shar -o contool.shar Makefile README contool.c contool.man misc.c sample.filter icons icons/*
  67. END_OF_FILE
  68. if test 702 -ne `wc -c <'Makefile'`; then
  69.     echo shar: \"'Makefile'\" unpacked with wrong size!
  70. fi
  71. # end of 'Makefile'
  72. fi
  73. if test -f 'README' -a "${1}" != "-c" ; then 
  74.   echo shar: Will not clobber existing file \"'README'\"
  75. else
  76. echo shar: Extracting \"'README'\" \(3733 characters\)
  77. sed "s/^X//" >'README' <<'END_OF_FILE'
  78. X     Contool Version 2.1
  79. X     
  80. X     Change history:
  81. X         1.0    20 Jun 88    Original release
  82. X         1.1    30 Jun 88    Added -p option to pop open when messages
  83. X                        arrive.  Suggested by Doug Lind
  84. X                        (lind@perron.ms.washington.edu).
  85. X                     Added alternate icon sets for more attractive
  86. X                        appearance when messages arrive.  Alternate
  87. X                        set two is from David Eckelcamp 
  88. X                        (eckelcamp@mcc.com).
  89. X                     Cleaned up Makefile.  Again, courtesy of
  90. X                        David Eckelcamp.
  91. X    2.0    23 Aug 88    Added automatic reload of filters when
  92. X                   filter file is modified.  Suggested by
  93. X                   Craig Musicant (cmusican@stanford.prime.com).
  94. X                Filter strings are now regular expressions.
  95. X                   Provided by jqj@hogg.cc.uoregon.edu.
  96. X                Reworked frame menu, based upon diffs posted
  97. X                   to sun-source@titan.rice.edu.
  98. X                Added protection from overflowing the text edit
  99. X                   window when too many messages arrive.
  100. X                Filters can now be read from any file, not
  101. X                   just ~/.contool.
  102. X    2.1    10 Feb 89    Added logging capability, courtesy of
  103. X                   Gregory Bond (gnb@melba.bby.oz.au).
  104. X
  105. X     Contool will capture and display system console messages with timestamps.
  106. XIt is a replacement for the standard Sun console, which is created with 
  107. X"cmdtool -C".  Contool will flash its icon and beep when messages are written
  108. Xto the icon, so you can keep it closed on your desktop until a message arrives.
  109. XYou can modify this beeping and flashing behavior; see the man page for more
  110. Xdetails.
  111. X
  112. X     Contool comes with several icons which you can use for different flash
  113. Xstyles.  The default is a flashing stop sign; some of us prefer a little
  114. Xmonitor whose screen flashes.  To achieve this behavior, you can invoke
  115. X
  116. X    contool -g contool.icon -b contool.icon -f contool_bad.icon
  117. X
  118. Xto set the good, bad, and flash icons.
  119. X
  120. X     You can instruct contool to filter and ignore certain common console
  121. Xmessages.  The man file explains how to create a file of filters in 
  122. X~/.contool; the included sample.filter is how my filters are set up.  You
  123. Xcan modify this to suit yourself, and copy it to ~/.contool.
  124. X
  125. X     Before building contool, you need to check several site dependencies
  126. Xin the Makefile and contool.c.  These paths are:
  127. X
  128. X    In Makefile:
  129. X        BIN        Where the executable will go, normally
  130. X                /usr/local/bin
  131. X        MANDIR        Where the man page will go, normally
  132. X                /usr/man/manl
  133. X        MANEXT        The man page extension, usually 'l',
  134. X                for local man pages.  You may want to
  135. X                make MANDIR /usr/man/man1, in which case
  136. X                MANEXT should be '1'.
  137. X
  138. X        ICON_DIRECTORY    Where you will keep the contool icons.
  139. X                On our system, this is /usr/local/images.
  140. X                Contool is shipped with this set to "./icons/",
  141. X                so that it will compile in the directory 
  142. X                in which you unshar'ed it.  Move the icons
  143. X                to your local icon repository, and change 
  144. X                this path accordingly.  MAKE SURE IT ENDS
  145. X                IN A '/'!
  146. X
  147. X    In contool.c:
  148. X        You may wish to use an alternate icon set for contool.  Simply
  149. X        uncomment the set you want to use as noted in contool.c.
  150. X
  151. XOnce you have adjusted these values, just type "make contool" or "make
  152. Xinstall".  
  153. X
  154. X     Contool honors window command line options, described in suntools(1),
  155. Xso you can change the default window size, icon position, etc.  We like
  156. Xto bring contool up closed, using "-Wi".
  157. X
  158. X     Comments, bugs, to me, please.  I would be very interested in your 
  159. Ximpressions of contool and any suggestions you might have to make it better.
  160. XBy the way, there are a few convenient untility routines in misc.c you might
  161. Xfind useful in other programs you are writing.
  162. X
  163. XChuck Musciano
  164. XAdvanced Technology Department
  165. XHarris Corporation
  166. XPO Box 37, MS 3A/1912
  167. XMelbourne, FL 32902
  168. X(407) 727-6131
  169. XARPA: chuck@trantor.harris-atd.com
  170. END_OF_FILE
  171. if test 3733 -ne `wc -c <'README'`; then
  172.     echo shar: \"'README'\" unpacked with wrong size!
  173. fi
  174. # end of 'README'
  175. fi
  176. if test -f 'contool.c' -a "${1}" != "-c" ; then 
  177.   echo shar: Will not clobber existing file \"'contool.c'\"
  178. else
  179. echo shar: Extracting \"'contool.c'\" \(21726 characters\)
  180. sed "s/^X//" >'contool.c' <<'END_OF_FILE'
  181. X/************************************************************************/
  182. X/*    Copyright 1988 by Chuck Musciano and Harris Corporation        */
  183. X/*                                    */
  184. X/*    Permission to use, copy, modify, and distribute this software    */
  185. X/*    and its documentation for any purpose and without fee is    */
  186. X/*    hereby granted, provided that the above copyright notice    */
  187. X/*    appear in all copies and that both that copyright notice and    */
  188. X/*    this permission notice appear in supporting documentation, and    */
  189. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  190. X/*    used in advertising or publicity pertaining to distribution    */
  191. X/*    of the software without specific, written prior permission.    */
  192. X/*    Chuck Musciano and Harris Corporation make no representations    */
  193. X/*    about the suitability of this software for any purpose.  It is    */
  194. X/*    provided "as is" without express or implied warranty.        */
  195. X/************************************************************************/
  196. X
  197. X
  198. X/************************************************************************/
  199. X/*                                    */
  200. X/*    contool:    capture and display timestamped console i/o    */
  201. X/*                                    */
  202. X/************************************************************************/
  203. X
  204. X#include    <stdio.h>
  205. X#include    <fcntl.h>
  206. X#include    <sys/ioctl.h>
  207. X#include    <sys/types.h>
  208. X#include    <sys/stat.h>
  209. X
  210. X#include    <suntool/sunview.h>
  211. X#include    <suntool/textsw.h>
  212. X#include    <suntool/icon_load.h>
  213. X
  214. X/**************** Site dependent parameters ****************************/
  215. X
  216. X/* Where the default contool icons are kept.  !Must end in '/'! */
  217. X
  218. X#if !defined(ICON_DIRECTORY)
  219. X#define        ICON_DIRECTORY        "./icons/"
  220. X#endif
  221. X
  222. X/* The default icon names.  Alternate sets are shown, and you might want
  223. X   to try these instead of the default set by uncommenting the desired set. */
  224. X
  225. X/* This set gives a blinking stop sign when messages arrive. */
  226. X#define        GOOD_ICON        "contool.icon"
  227. X#define        BAD_ICON        "stopsign.icon"
  228. X#define        INVERSE_ICON        "stopsign_inv.icon"
  229. X
  230. X/* This set gives a terminal, labelled "Console", in a box.  The screen
  231. X   flashes when messages arrive. */
  232. X/* #define        GOOD_ICON    "contool.icon" */
  233. X/* #define        BAD_ICON    "contool.icon" */
  234. X/* #define        INVERSE_ICON    "contool_bad.icon" */
  235. X
  236. X/* This set gives a terminal, without a box.  Again, the screen flashes
  237. X   when messages arrive. */
  238. X/* #define        GOOD_ICON    "console1.icon" */
  239. X/* #define        BAD_ICON    "console1_bad.icon" */
  240. X/* #define        INVERSE_ICON    "console1_flash.icon" */
  241. X
  242. X/*************** End of site dependencies ******************************/
  243. X
  244. X#define        TOOL_LABEL        "<< Console Tool 2.1 >>"
  245. X
  246. X#define        MAX_FILTERS        64
  247. X
  248. X#define        strsave(s)        ((char *) strcpy(malloc(strlen(s) + 1), s))
  249. X
  250. X#define        BEEP_COUNT        3
  251. X#define        TS_INTERVAL        60
  252. X
  253. X#define        NORMAL_MODE        1
  254. X#define        QUIET_MODE        2
  255. X#define        IGNORE_MODE        3
  256. X
  257. X#define        TEXT_SIZE_LIMIT        32768
  258. X#define        TEXT_SIZE_FUZZ        1024
  259. X#define        TEXT_DELETE_SIZE    1024
  260. X
  261. X#define        INPUT_BUFFER_SIZE    4096
  262. X
  263. X/*************** Stuff that regexp(3) needs ****************************/
  264. X
  265. Xstatic    regexp_error();
  266. X
  267. X#define        INIT            register char *expbuf = ep, *sp = instring;
  268. X#define        GETC()            (*sp++)
  269. X#define        PEEKC()            (*sp)
  270. X#define        UNGETC(c)        (--sp)
  271. X#define        RETURN(p)        {bcopy(expbuf, sp = (char *) malloc(p - expbuf), p - expbuf); return(sp);}
  272. X#define        ERROR(val)        {regexp_error(val, instring); return(NULL);}
  273. X
  274. X#include    <regexp.h>
  275. X
  276. X/*************** Things that contool uses ******************************/
  277. X
  278. Xstruct    f_rec    {char    *start;
  279. X         char    *end;
  280. X         int    scircf;
  281. X         int    ecircf;
  282. X         int    mode;
  283. X        };
  284. X
  285. Xchar    *ct_usage = "usage: contool [-b <file>] [-c <file>] [-d <size>] [-f <file>] [-g <file>] [-l <size>] [-o <logfile>] [-p] [-r <amt>] [-s <amt>]\n";
  286. X
  287. Xstatic    Frame    bf;
  288. Xstatic    Textsw    text;
  289. Xstatic    Icon    good, bad, inverse;
  290. Xstatic    struct    pixrect    *good_pr, *bad_pr, *inv_pr;
  291. Xstatic    Menu_item    stop_blink;
  292. Xstatic    Rect    open_rect;
  293. X
  294. Xstatic    char    bad_icon[256];            /* -b */
  295. Xstatic    char    filter_path[256];        /* -c */
  296. Xstatic    int    delete_amt = TEXT_DELETE_SIZE;    /* -d */
  297. Xstatic    char    inv_icon[256];            /* -f */
  298. Xstatic    char    good_icon[256];            /* -g */
  299. Xstatic    int    size_limit = TEXT_SIZE_LIMIT;    /* -l */
  300. Xstatic    int    pop_open = FALSE;        /* -p */
  301. Xstatic    int    resolution = TS_INTERVAL;    /* -r */
  302. Xstatic    int    beep_amount = BEEP_COUNT;    /* -s */
  303. X
  304. Xstatic    int    bad_is_up;
  305. Xstatic    int    beep_count;
  306. Xstatic    int    blinking = FALSE;
  307. Xstatic    int    event_in_progress = FALSE;
  308. Xstatic    int    explicit_filters = FALSE;
  309. Xstatic    struct    f_rec    filter[MAX_FILTERS];
  310. Xstatic    int    filters = 0;
  311. Xstatic    int    icon_height;
  312. Xstatic    int    icon_width;
  313. Xstatic    FILE    *master = NULL;
  314. Xstatic    int    old_time = 0;
  315. Xstatic    char    *program;
  316. Xstatic    FILE    *slave = NULL;
  317. Xstatic  FILE    *logfile = NULL;
  318. X
  319. Xstatic    struct    itimerval    timer = {{0, 500000}, {0, 500000}};
  320. X
  321. X/************************************************************************/
  322. X/*    First, some basic console utility routines             */
  323. X/************************************************************************/
  324. X
  325. X/************************************************************************/
  326. Xstatic    acquire_console(path)
  327. X
  328. Xchar    *path;
  329. X
  330. X{
  331. X    if (ioctl(fileno(slave), TIOCCONS, NULL) == -1) {
  332. X       fprintf(stderr, "%s: could not attach %s to /dev/console\n", program, path);
  333. X       exit(1);
  334. X       }
  335. X}
  336. X
  337. X/************************************************************************/
  338. Xstatic    clear_messages()
  339. X
  340. X{
  341. X    textsw_reset(text, 0, 0);
  342. X    old_time = 0;
  343. X}
  344. X
  345. X/************************************************************************/
  346. Xstatic    stop_blinking()
  347. X
  348. X{
  349. X    notify_set_itimer_func(bf, NULL, ITIMER_REAL, NULL, NULL);
  350. X    window_set(bf, FRAME_ICON, good, 0);
  351. X    blinking = FALSE;
  352. X    menu_set(stop_blink, MENU_INACTIVE, TRUE, 0);
  353. X}
  354. X
  355. X/************************************************************************/
  356. X/*    Now, filter and regular expression handlers            */
  357. X/************************************************************************/
  358. X
  359. X/************************************************************************/
  360. Xstatic    internal_message(a, b, c, d, e, f)
  361. X
  362. Xint    a, b, c, d, e, f;
  363. X
  364. X{    char    buf[512];
  365. X
  366. X    sprintf(buf, a, b, c, d, e, f);
  367. X    time_stamp();
  368. X    write_log(buf);
  369. X    do_insertion(buf, strlen(buf));
  370. X}
  371. X
  372. X/************************************************************************/
  373. Xstatic    internal_error(a, b, c, d, e, f)
  374. X
  375. Xint    a, b, c, d, e, f;
  376. X
  377. X{    char    buf[512];
  378. X
  379. X    sprintf(buf, a, b, c, d, e, f);
  380. X    time_stamp();
  381. X    fprintf(stderr, buf);
  382. X}
  383. X
  384. X/************************************************************************/
  385. Xstatic    int    match_exp(exp, circ, str)
  386. X
  387. Xchar    *exp;
  388. Xint    circ;
  389. Xchar    *str;
  390. X
  391. X{
  392. X    circf = circ;
  393. X    return(step(str, exp));
  394. X}
  395. X
  396. X/************************************************************************/
  397. Xstatic    regexp_error(val, string)
  398. X
  399. Xint    val;
  400. Xchar    *string;
  401. X
  402. X{    char    *msg;
  403. X
  404. X    switch (val) {
  405. X       case 11 : msg = "range endpoint too large";
  406. X       case 16 : msg = "bad number";
  407. X       case 25 : msg = "\"\\digit\" out of range";
  408. X       case 36 : msg = "illegal or missing delimiter";
  409. X       case 41 : msg = "no remembered search string";
  410. X       case 42 : msg = "\\(\\) imbalance";
  411. X       case 43 : msg = "too many \\(";
  412. X       case 44 : msg = "more than 2 numbers given in \\{\\}";
  413. X       case 45 : msg = "} expected after \\";
  414. X       case 46 : msg = "first number exceeds second in \\{\\}";
  415. X       case 49 : msg = "[] imbalance";
  416. X       case 50 : msg = "regular expression overflow";
  417. X       default : msg = "regular expression compilation error";
  418. X       }
  419. X    internal_error("*** %s: %s in '%s'\n", program, msg, string);
  420. X}
  421. X
  422. X/************************************************************************/
  423. Xstatic    load_filters()
  424. X
  425. X{    FILE    *f;
  426. X    char    buf[256], rbuf[1024], *token[6], *p, *index();
  427. X    int    count;
  428. X    struct    stat    sb;
  429. X    static    int    load_time = 0;
  430. X
  431. X    if (stat(filter_path, &sb) == -1) {
  432. X       if (explicit_filters && load_time == 0) {
  433. X          internal_error("*** %s: filter file %s cannot be accessed\n", program, filter_path);
  434. X          load_time = 1;
  435. X          }
  436. X       return;
  437. X       }
  438. X    if (sb.st_mtime > load_time) {
  439. X       for (count = 0; count < filters; count++) {
  440. X          free(filter[count].start);
  441. X          if (filter[count].end)
  442. X             free(filter[count].end);
  443. X          }
  444. X       filters = 0;
  445. X       }
  446. X    else
  447. X       return;
  448. X
  449. X    if ((f = fopen(filter_path, "r")) != NULL) {
  450. X       while (getline(f, buf, 256) != EOF) {
  451. X          if ((p = index(buf, '#')) != NULL)
  452. X             *p = '\0';
  453. X          if (strlen(buf) == 0 || verify(buf, " "))
  454. X             continue;
  455. X          tokenize(buf, &count, token, 6);
  456. X          if (count == 2 || count == 4) {
  457. X             if (strcmp(lower(token[0]), "ignore") == 0)
  458. X                filter[filters].mode = IGNORE_MODE;
  459. X             else if (strcmp(token[0], "quiet") == 0)
  460. X                filter[filters].mode = QUIET_MODE;
  461. X             else {
  462. X                internal_error("*** %s: invalid contool filter:\n***\t%s\n", program, buf);
  463. X                continue;
  464. X                }
  465. X             if ((filter[filters].start = compile(token[1], rbuf, rbuf+1024, '\0')) == NULL)
  466. X                continue;
  467. X             filter[filters].scircf = circf;
  468. X             if (count == 4)
  469. X                if (strcmp(lower(token[2]), "to") == 0) {
  470. X                   filter[filters].end = compile(token[3], rbuf, rbuf+1024, '\0');
  471. X                   filter[filters].ecircf = circf;
  472. X                   }
  473. X                else {
  474. X                   internal_error("*** %s: invalid contool filter:\n***\t%s\n", program, buf);
  475. X                   continue;
  476. X                   }
  477. X             else
  478. X                filter[filters].end = NULL;
  479. X             filters++;
  480. X             }
  481. X          else
  482. X             internal_error("*** %s: invalid contool filter:\n\t%s\n", program, buf);
  483. X          }
  484. X       fclose(f);
  485. X       internal_message("*** filters loaded from %s\n", filter_path);
  486. X       load_time = sb.st_mtime;
  487. X       }
  488. X    else
  489. X       internal_error("*** %s: could not read filter file %s\n", program, filter_path);
  490. X}
  491. X
  492. X/************************************************************************/
  493. X/*    Various event handlers for the console frame            */
  494. X/************************************************************************/
  495. X
  496. X/************************************************************************/
  497. Xstatic    Notify_value    blink_proc(me, which)
  498. X
  499. Xint    *me;
  500. Xint    which;
  501. X
  502. X{
  503. X    if (event_in_progress)
  504. X       return(NOTIFY_DONE);
  505. X    if (beep_count > 0) {
  506. X       window_bell(bf);
  507. X       beep_count--;
  508. X       }
  509. X    else if (blinking) {
  510. X       if (bad_is_up)
  511. X          window_set(bf, FRAME_ICON, inverse, 0);
  512. X       else
  513. X          window_set(bf, FRAME_ICON, bad, 0);
  514. X       bad_is_up = !bad_is_up;
  515. X       }
  516. X    if (beep_count == 0 && !blinking)
  517. X       notify_set_itimer_func(bf, blink_proc, ITIMER_REAL, NULL, NULL);
  518. X    return(NOTIFY_DONE);
  519. X}
  520. X
  521. X/************************************************************************/
  522. Xstatic    Notify_value    close_proc(frame, event, arg, type)
  523. X
  524. XFrame    frame;
  525. XEvent    *event;
  526. XNotify_arg    arg;
  527. XNotify_event_type    type;
  528. X
  529. X{    int    init_closed, curr_closed, is_resize;
  530. X    Notify_value    value;
  531. X    Rect    *temp;
  532. X
  533. X    event_in_progress = TRUE;
  534. X    init_closed = (int) window_get(frame, FRAME_CLOSED);
  535. X    is_resize = (event_id(event) == WIN_RESIZE);
  536. X    value = notify_next_event_func(frame, event, arg, type);
  537. X    curr_closed = (int) window_get(frame, FRAME_CLOSED);
  538. X    if (init_closed != curr_closed)
  539. X       if (!curr_closed && blinking) {
  540. X          notify_set_itimer_func(bf, blink_proc, ITIMER_REAL, NULL, NULL);
  541. X          window_set(bf, FRAME_ICON, good, 0);
  542. X          blinking = FALSE;
  543. X          menu_set(stop_blink, MENU_INACTIVE, TRUE, 0);
  544. X          }
  545. X    event_in_progress = FALSE;
  546. X    if (is_resize) {
  547. X       temp = (Rect *) window_get(frame, FRAME_OPEN_RECT);
  548. X       if (temp->r_width <= icon_width && temp->r_height <= icon_height) { /* override spurious resize request */
  549. X          window_set(frame, FRAME_OPEN_RECT, &open_rect, FRAME_CLOSED, FALSE, 0);
  550. X          notify_set_itimer_func(bf, blink_proc, ITIMER_REAL, NULL, NULL);
  551. X          window_set(bf, FRAME_ICON, good, 0);
  552. X          blinking = FALSE;
  553. X          menu_set(stop_blink, MENU_INACTIVE, TRUE, 0);
  554. X          }
  555. X       else /* save away new open rect */
  556. X          open_rect = *temp;
  557. X       }
  558. X    return(value);
  559. X}
  560. X
  561. X/************************************************************************/
  562. Xstatic    Notify_value    destroy_proc(frame, status)
  563. X
  564. XFrame    frame;
  565. XDestroy_status    status;
  566. X
  567. X{
  568. X    if (status == DESTROY_CHECKING) {
  569. X       textsw_reset(text, 0, 0);
  570. X       return(NOTIFY_DONE);
  571. X       }
  572. X    else
  573. X       return(notify_next_destroy_func(frame, status));
  574. X}
  575. X
  576. X/************************************************************************/
  577. X/*    Routines which handle capturing and displaying messages        */
  578. X/************************************************************************/
  579. X
  580. X/************************************************************************/
  581. Xstatic    write_log(s)
  582. X
  583. Xchar    *s;
  584. X
  585. X{    int    t;
  586. X    static    char    hostname[100] = "";
  587. X
  588. X    if (logfile) {
  589. X       if (*hostname == NULL) 
  590. X          if (gethostname(hostname, 99) != 0)
  591. X             strcpy(hostname, "(unknown)");
  592. X       t = time(0);
  593. X       fseek(logfile, 0L, 2);
  594. X       fprintf(logfile, "%s\t%.16s\t%s", hostname, ctime(&t) + 4, s);
  595. X       fflush(logfile);
  596. X       }
  597. X}
  598. X
  599. X/************************************************************************/
  600. Xstatic    do_insertion(buf, len)
  601. X
  602. Xchar    *buf;
  603. Xint    len;
  604. X
  605. X{    int    first, last;
  606. X
  607. X    while (len > size_limit - ((int) window_get(text, TEXTSW_LENGTH) - TEXT_SIZE_FUZZ)) { /* make some room */
  608. X       first = 1;
  609. X       last = TEXTSW_INFINITY;
  610. X       if (textsw_find_bytes(text, &first, &last, "\n<<<", 4, 0) == -1)
  611. X          if (textsw_find_bytes(text, &first, &last, "\n", 1, 0) == -1)
  612. X             first = delete_amt;
  613. X       textsw_delete(text, 0, first + 1);
  614. X       }
  615. X    window_set(text, TEXTSW_INSERTION_POINT, TEXTSW_INFINITY, 0);
  616. X    textsw_insert(text, buf, len);
  617. X}
  618. X
  619. X/************************************************************************/
  620. Xstatic    time_stamp()
  621. X
  622. X{    int    t, pos;
  623. X    char    buf[5];
  624. X
  625. X    t = time(0);
  626. X    if (t - old_time >= resolution) {
  627. X       window_set(text, TEXTSW_INSERTION_POINT, TEXTSW_INFINITY, 0);
  628. X       pos = (int) window_get(text, TEXTSW_LENGTH);
  629. X       if (pos != 0) {
  630. X          window_get(text, TEXTSW_CONTENTS, pos - 1, buf, 1);
  631. X          if (buf[0] != '\n')
  632. X             do_insertion("\n", 1);
  633. X          }
  634. X       do_insertion("\n<<< ", 5);
  635. X       do_insertion(ctime(&t), 24);
  636. X       do_insertion(" >>>\n", 5);
  637. X       old_time = t;
  638. X       }
  639. X}
  640. X
  641. X/************************************************************************/
  642. Xstatic    Notify_value    input_func(me, fd)
  643. X
  644. Xint    *me;
  645. Xint    fd;
  646. X
  647. X{    char    old_c, *s, *t, *index();
  648. X    int    i, count, do_blink = FALSE;
  649. X    static    int    curr_filter = -1, curr_mode = NORMAL_MODE;
  650. X    static    char    in_buf[INPUT_BUFFER_SIZE + 2];
  651. X
  652. X    while ((count = read(fileno(master), in_buf, INPUT_BUFFER_SIZE)) >= 0) {
  653. X       in_buf[count] = '\0';
  654. X       while (s = index(in_buf, '\015')) {
  655. X          strcpy(s, s + 1);
  656. X          count--;
  657. X          }
  658. X       for (t = in_buf; *t; *s = old_c, t = s) {
  659. X          if (s = index(t, '\n')) {
  660. X             old_c = *++s;
  661. X             *s = '\0';
  662. X             }
  663. X          else {
  664. X             s = t + strlen(t);
  665. X             old_c = '\0';
  666. X             }
  667. X          if (curr_mode == NORMAL_MODE) {
  668. X             load_filters();
  669. X             for (i = 0; i < filters; i++)
  670. X                if (match_exp(filter[i].start, filter[i].scircf, t)) {
  671. X                   if (filter[i].mode == QUIET_MODE) {
  672. X                      time_stamp();
  673. X              write_log(t);
  674. X                      do_insertion(t, strlen(t));
  675. X                      }
  676. X                   if (filter[i].end) {
  677. X                      curr_mode = filter[i].mode;
  678. X                      curr_filter = i;
  679. X                      }
  680. X                   break;
  681. X                   }
  682. X             if (i == filters) {
  683. X                time_stamp();
  684. X            write_log(t);
  685. X                do_insertion(t, strlen(t));
  686. X                do_blink = TRUE;
  687. X                }
  688. X             }
  689. X          else {
  690. X             if (curr_mode == QUIET_MODE) {
  691. X                time_stamp();
  692. X            write_log(t);
  693. X            do_insertion(t, strlen(t));
  694. X                }
  695. X             if (match_exp(filter[curr_filter].end, filter[curr_filter].ecircf, t)) {
  696. X                curr_mode = NORMAL_MODE;
  697. X                curr_filter = -1;
  698. X                }
  699. X             }
  700. X          }
  701. X       }
  702. X    window_set(text, TEXTSW_UPDATE_SCROLLBAR, 0);
  703. X    if (do_blink) {
  704. X       if (pop_open)
  705. X          window_set(bf, FRAME_CLOSED, FALSE, 0);
  706. X       if (window_get(bf, FRAME_CLOSED) && !blinking) {
  707. X          window_set(bf, FRAME_ICON, bad, 0);
  708. X          blinking = TRUE;
  709. X          bad_is_up = TRUE;
  710. X          menu_set(stop_blink, MENU_INACTIVE, FALSE, 0);
  711. X          }
  712. X       beep_count = beep_amount;
  713. X       notify_set_itimer_func(bf, blink_proc, ITIMER_REAL, &timer, NULL);
  714. X       }
  715. X    return(NOTIFY_DONE);
  716. X}
  717. X
  718. X/************************************************************************/
  719. X/*    Routines which parse options, create windows, and main()    */
  720. X/************************************************************************/
  721. X
  722. X/************************************************************************/
  723. Xstatic    parse_options(argc, argv)
  724. X
  725. Xint    *argc;
  726. Xchar    **argv;
  727. X
  728. X{    char    *s, c;
  729. X
  730. X    strcpy(good_icon, ICON_DIRECTORY);
  731. X    strcat(good_icon, GOOD_ICON);
  732. X    strcpy(bad_icon, ICON_DIRECTORY);
  733. X    strcat(bad_icon, BAD_ICON);
  734. X    strcpy(inv_icon, ICON_DIRECTORY);
  735. X    strcat(inv_icon, INVERSE_ICON);
  736. X
  737. X    strcpy(filter_path, getenv("HOME"));
  738. X    strcat(filter_path, "/.contool");
  739. X
  740. X    while ((c = getopt(argc, argv, "b:c:d:f:g:l:o:pr:s:?", &s)) != EOF)
  741. X       switch (c) {
  742. X          case 'b' : strcpy(bad_icon, s);
  743. X                   break;
  744. X          case 'c' : strcpy(filter_path, s);
  745. X                   explicit_filters = TRUE;
  746. X                   break;
  747. X          case 'd' : if (verify(s, "0123456789"))
  748. X                      delete_amt = atoi(s);
  749. X                   else {
  750. X                      fprintf(stderr, "%s: invalid delete amount: %s\n", program, s);
  751. X                      exit(1);
  752. X                      }
  753. X                   break;
  754. X          case 'f' : strcpy(inv_icon, s);
  755. X                   break;
  756. X          case 'g' : strcpy(good_icon, s);
  757. X                   break;
  758. X          case 'l' : if (verify(s, "0123456789"))
  759. X                      window_set(text, TEXTSW_MEMORY_MAXIMUM, (size_limit = atoi(s)) + TEXT_SIZE_FUZZ, 0);
  760. X                   else {
  761. X                      fprintf(stderr, "%s: invalid message limit: %s\n", program, s);
  762. X                      exit(1);
  763. X                      }
  764. X                   break;
  765. X          case 'o':  if ((logfile = fopen(s, "a")) == NULL) {
  766. X                   fprintf(stderr, "%s : can't open logfile: %s\n", program, s);
  767. X                exit(1);
  768. X                 }
  769. X                 break;
  770. X          case 'p' : pop_open = TRUE;
  771. X                   break;
  772. X          case 'r' : if (verify(s, "0123456789"))
  773. X                      resolution = atoi(s);
  774. X                   else {
  775. X                      fprintf(stderr, "%s: invalid timestamp resolution: %s\n", program, s);
  776. X                      exit(1);
  777. X                      }
  778. X                   break;
  779. X          case 's' : if (verify(s, "0123456789"))
  780. X                      beep_amount = atoi(s);
  781. X                   else {
  782. X                      fprintf(stderr, "%s: invalid beep count: %s\n", program, s);
  783. X                      exit(1);
  784. X                      }
  785. X                   break;
  786. X          case '?' : fprintf(stderr, ct_usage);
  787. X                   exit(0);
  788. X                   break;
  789. X          default  : fprintf(stderr, ct_usage);
  790. X                     exit(1);
  791. X          }
  792. X}
  793. X
  794. X/************************************************************************/
  795. Xstatic    load_icons()
  796. X
  797. X{    char    msg[IL_ERRORMSG_SIZE];
  798. X
  799. X    if ((good_pr = icon_load_mpr(good_icon, msg)) == NULL) {
  800. X       fprintf(stderr, "%s: %s\n", program, msg);
  801. X       exit(1);
  802. X       }
  803. X    good = icon_create(ICON_IMAGE, good_pr,
  804. X               ICON_LABEL, "",
  805. X               ICON_WIDTH, good_pr->pr_size.x,
  806. X               ICON_HEIGHT, good_pr->pr_size.y,
  807. X               0);
  808. X    icon_width = good_pr->pr_size.x;
  809. X    icon_height = good_pr->pr_size.y;
  810. X    if ((bad_pr = icon_load_mpr(bad_icon, msg)) == NULL) {
  811. X       fprintf(stderr, "%s: %s\n", program, msg);
  812. X       exit(1);
  813. X       }
  814. X    bad = icon_create(ICON_IMAGE, bad_pr,
  815. X              ICON_LABEL, "",
  816. X              ICON_WIDTH, bad_pr->pr_size.x,
  817. X              ICON_HEIGHT, bad_pr->pr_size.y,
  818. X              0);
  819. X    if (bad_pr->pr_size.x > icon_width)
  820. X       icon_width = bad_pr->pr_size.x;
  821. X    if (bad_pr->pr_size.y > icon_height)
  822. X       icon_height = bad_pr->pr_size.y;
  823. X    if (*inv_icon == '\0')
  824. X       strcpy(inv_icon, bad_icon);
  825. X    if ((inv_pr = icon_load_mpr(inv_icon, msg)) == NULL) {
  826. X       fprintf(stderr, "%s: %s\n", program, msg);
  827. X       exit(1);
  828. X       }
  829. X    inverse = icon_create(ICON_IMAGE, inv_pr,
  830. X                  ICON_LABEL, "",
  831. X                  ICON_WIDTH, inv_pr->pr_size.x,
  832. X                  ICON_HEIGHT, inv_pr->pr_size.y,
  833. X                  0);
  834. X    if (inv_pr->pr_size.x > icon_width)
  835. X       icon_width = inv_pr->pr_size.x;
  836. X    if (inv_pr->pr_size.y > icon_height)
  837. X       icon_height = inv_pr->pr_size.y;
  838. X    window_set(bf, FRAME_ICON, good, 0);
  839. X}
  840. X
  841. X/************************************************************************/
  842. Xmain(argc, argv)
  843. X
  844. Xint    argc;
  845. Xchar    **argv;
  846. X
  847. X{    char    *path, *open_psuedo_tty(), **saveargs();
  848. X    int    i;
  849. X    Menu    menu;
  850. X
  851. X    program = strsave(argv[0]);
  852. X
  853. X    bf = window_create(NULL, FRAME, 
  854. X                  FRAME_ARGC_PTR_ARGV, &argc, argv,
  855. X                  FRAME_LABEL, TOOL_LABEL,
  856. X               0);
  857. X    text = window_create(bf, TEXTSW, 
  858. X                    TEXTSW_DISABLE_CD, TRUE,
  859. X                    TEXTSW_DISABLE_LOAD, TRUE, 
  860. X                    TEXTSW_AGAIN_RECORDING, FALSE,
  861. X                    TEXTSW_IGNORE_LIMIT, TEXTSW_INFINITY,
  862. X                    TEXTSW_MEMORY_MAXIMUM, size_limit + TEXT_SIZE_FUZZ,
  863. X                 0);
  864. X    open_rect = *((Rect *) window_get(bf, FRAME_OPEN_RECT));
  865. X
  866. X    argv = saveargs(argc, argv);
  867. X    parse_options(&argc, argv);
  868. X    if (argc != 1) {
  869. X       fprintf(stderr, ct_usage);
  870. X       exit(1);
  871. X       }
  872. X
  873. X    load_icons();
  874. X
  875. X    path = open_psuedo_tty(&master, "r", &slave, "w");
  876. X    if (master == NULL) {
  877. X       fprintf(stderr, "%s: couldn't open any psuedo-tty\n");
  878. X       exit(1);
  879. X       }
  880. X    if (slave == NULL) {
  881. X       fprintf(stderr, "%s: couldn't open slave side of %s\n", program, path);
  882. X       exit(1);
  883. X       }
  884. X
  885. X    i = fcntl(fileno(master), F_GETFL, 0);
  886. X    i |= FNDELAY;
  887. X    if (fcntl(fileno(master), F_SETFL, i) == -1) {
  888. X       fprintf(stderr, "%s: could not force %s to non-blocking i/o\n", program, path);
  889. X       exit(1);
  890. X       }
  891. X
  892. X    acquire_console(path);
  893. X
  894. X    stop_blink = menu_create_item(MENU_STRING, "Stop Blinking",
  895. X                      MENU_INACTIVE, TRUE,
  896. X                      MENU_ACTION_PROC, stop_blinking,
  897. X                      0);
  898. X    menu = menu_create(MENU_APPEND_ITEM, stop_blink,
  899. X               MENU_ACTION_ITEM, "Become Console", acquire_console,
  900. X               MENU_ACTION_ITEM, "Clear Messages", clear_messages,
  901. X               MENU_PULLRIGHT_ITEM, "Frame", window_get(bf, WIN_MENU),
  902. X               0);
  903. X    window_set(bf, WIN_MENU, menu, 0);
  904. X
  905. X    notify_set_input_func(bf, input_func, fileno(master));
  906. X    notify_interpose_destroy_func(bf, destroy_proc);
  907. X    notify_interpose_event_func(bf, close_proc, NOTIFY_SAFE);
  908. X
  909. X    load_filters();
  910. X
  911. X    window_main_loop(bf);
  912. X}
  913. END_OF_FILE
  914. if test 21726 -ne `wc -c <'contool.c'`; then
  915.     echo shar: \"'contool.c'\" unpacked with wrong size!
  916. fi
  917. # end of 'contool.c'
  918. fi
  919. if test -f 'contool.man' -a "${1}" != "-c" ; then 
  920.   echo shar: Will not clobber existing file \"'contool.man'\"
  921. else
  922. echo shar: Extracting \"'contool.man'\" \(4928 characters\)
  923. sed "s/^X//" >'contool.man' <<'END_OF_FILE'
  924. X.TH CONTOOL 1 "10 December 1986"
  925. X.SH NAME
  926. Xcontool \- capture and display console output
  927. X.SH SYNOPSIS
  928. X.IP "\fBcontool\fP"
  929. X[\fB\(hyb\fP \fIfile\fP] [\fB\(hyc\fP \fIfile\fP] [\fB\(hyd\fP \fIsize\fP] [\fB\(hyf\fP \fIfile\fP] [\fB\(hyg\fP \fIfile\fP] [\fB\(hyl\fP \fIsize\fP] [\f3\(hyo\fP \f2logfile\fP] [\f3\(hyp\fP] [\f3\(hyr\fP \f2amount\fP] [\f3\(hys\fP \f2count\fP] 
  930. X.SH DESCRIPTION
  931. X.LP
  932. X\f2Contool\fP captures and displays any messages sent to the system console.
  933. XEach message is timestamped as it arrives.  The messages are displayed in a
  934. Xscrolling text window, so the user can scroll through old messages.
  935. X.LP
  936. XWhen a message arrives, \f3contool\fP will beep and, if closed, begin
  937. Xblinking its icon until the user opens the tool.  This behavior can be changed
  938. Xwith the various options, described below.
  939. X.LP
  940. X\f2Contool\fP must be run under \f2suntools\fP(1), and accepts the
  941. Xstandard window command line options.
  942. X.LP
  943. X\f2Contool\fP can be configured to ignore certain console messages using 
  944. Xentries in the file ~/.contool.  Each line in the file has the format
  945. X\*(lq\f2action start\fP [ \f3to\fP \f2stop\fP ]\*(rq.  The \fIstart\fP and
  946. X\fIstop\fP strings are regular expressions, as described in \fIed\fP(1).
  947. XEach line of text written
  948. Xto the console is compared against the list of \f2start\fP strings.  A match
  949. Xcauses the \f2action\fP to take place.  If the \f2action\fP is \f3quiet\fP, the
  950. Xmessage is written to the console, but no beeping or blinking occurs.  If it
  951. Xis \f3ignore\fP, the message is thrown away.  If the optional \f3to\fP clause is
  952. Xincluded, the desired \f2action\fP remains in effect until a line matching the \f2stop\fP
  953. Xstring is encountered.  Comments can be introduced into the file using the '#'
  954. Xcharacter.
  955. X.SH OPTIONS
  956. X.IP "\fB\\(hyb\fP \fIfile\fP"
  957. Xspecifies the \*(lqbad\*(rq icon to be displayed when a message
  958. Xhas arrived on the console.  The \f2file\fP must be in the format used by
  959. X\f2iconedit\fP(1).
  960. X.IP "\fB\\(hyc\fP \fIfile\fP"
  961. Xspecifies a different filter file.  If \fB\(hyc\fP is not used, \fIcontool\fP
  962. Xwill read filters from ~/.contool, if it exists.
  963. X.IP "\fB\\(hyd\fP \fIsize\fP"
  964. Xsets the amount of text that will be removed from the front of the message
  965. Xlog when the message size limit (see \fB\(hyl\fP, below) is exceeded.  At
  966. Xleast \fIsize\fP bytes will be removed, along with any text up to the start
  967. Xof the next message.  The default value is 1024 bytes.
  968. X.IP "\fB\\(hyf\fP \fIfile\fP"
  969. Xspecifies the \*(lqflash\*(rq icon which is alternated with the
  970. Xbad icon (see \f3\(hyb\fP, above) when a message has arrived on the console.
  971. XLike \f3\(hyb\fP, the file must be in the format used by \f2iconedit\fP(1).
  972. XTo disable the flashing feature, specify \*(lq\*(rq as the \f2file\fP.
  973. X.IP "\fB\\(hyg\fP \fIfile\fP"
  974. Xspecifies the \*(lqgood\*(rq icon which is displayed when
  975. Xno unviewed messages are present on the console.  This icon is displayed
  976. Xwhen the user closes \f2contool\fP, and remains displayed until a new message
  977. Xarrives.  Like \f3\(hyb\fP and \f3\(hyf\fP, the \f2file\fP must be in the
  978. Xformat used by \f2iconedit\fP(1).
  979. X.IP "\fB\\(hyl\fP \fIsize\fP"
  980. Xsets the limit, in bytes, on the number of messages that will be saved.
  981. XWhen a message would exceed this limit, some number of bytes of text (see 
  982. X\fB\(hyd\fP, above) will be deleted from the start of the message log.  The
  983. Xdefault value is 32768 bytes.
  984. X.IP "\fB\\(hyo\fP \fIfile\fP"
  985. Xinstructs contool to keep a log of all messages (that are accepted by
  986. Xthe filters) into the named \fIfile\fP.  This is useful for logging the
  987. Xconsole messages from a network of workstations into files on a
  988. Xserver, making administration of such a network much simpler.  Care
  989. Xshould be exercised in logging multiple machines to the one file; NFS
  990. Xsometimes doesn't append if concurrent updates are done.  This may be
  991. Xan NFS bug.
  992. X.IP "\f3\(hyp\fP"
  993. Xcauses contool to pop open when a message arrives.  By default,
  994. Xcontool stays closed and blinks when messages arrive.
  995. X.IP "\f3\(hyr\fP \f2amount\fP"
  996. Xcontrols the resolution of the timestamps placed in the 
  997. Xmessage display.  Normally, a message is not timestamped if it has arrived
  998. Xwithin sixty seconds of the last timestamp.  This prevents a cascade
  999. Xof messages from receiving several, identical timestamps.  If this option
  1000. Xis specified, the \f2amount\fP indicates the time, in seconds, to allow
  1001. Xbetween timestamps.
  1002. X.IP "\f3\(hys\fP \f2count\fP"
  1003. Xchanges the number of times \f2contool\fP will sound the bell
  1004. Xwhen a message arrives.  To disable the bell, set the \f2count\fP to zero.
  1005. X.SH FILES
  1006. X.ta 2i
  1007. Xcontool.icon    default \f3\(hyg\fP icon
  1008. X.br
  1009. Xstopsign.icon    default \f3\(hyb\fP icon
  1010. X.br
  1011. Xstopsign_inv.icon    default \f3\(hyf\fP icon
  1012. X.br
  1013. X~/.contool    filter pattern file
  1014. X.SH AUTHOR
  1015. X.LP
  1016. XChuck Musciano
  1017. X.br
  1018. XAdvanced Technology Department
  1019. X.br
  1020. XHarris Corporation
  1021. X.br
  1022. X(407) 727-6131
  1023. X.br
  1024. XARPA: chuck@trantor.harris-atd.com
  1025. X.SH BUGS
  1026. X.LP
  1027. X\f2Contool\fP is a view-only tool, and there is no way to type commands
  1028. Xon the console.
  1029. END_OF_FILE
  1030. if test 4928 -ne `wc -c <'contool.man'`; then
  1031.     echo shar: \"'contool.man'\" unpacked with wrong size!
  1032. fi
  1033. # end of 'contool.man'
  1034. fi
  1035. if test -f 'misc.c' -a "${1}" != "-c" ; then 
  1036.   echo shar: Will not clobber existing file \"'misc.c'\"
  1037. else
  1038. echo shar: Extracting \"'misc.c'\" \(6517 characters\)
  1039. sed "s/^X//" >'misc.c' <<'END_OF_FILE'
  1040. X/************************************************************************/
  1041. X/*    Copyright 1988 by Chuck Musciano and Harris Corporation        */
  1042. X/*                                    */
  1043. X/*    Permission to use, copy, modify, and distribute this software    */
  1044. X/*    and its documentation for any purpose and without fee is    */
  1045. X/*    hereby granted, provided that the above copyright notice    */
  1046. X/*    appear in all copies and that both that copyright notice and    */
  1047. X/*    this permission notice appear in supporting documentation, and    */
  1048. X/*    that the name of Chuck Musciano and Harris Corporation not be    */
  1049. X/*    used in advertising or publicity pertaining to distribution    */
  1050. X/*    of the software without specific, written prior permission.    */
  1051. X/*    Chuck Musciano and Harris Corporation make no representations    */
  1052. X/*    about the suitability of this software for any purpose.  It is    */
  1053. X/*    provided "as is" without express or implied warranty.        */
  1054. X/************************************************************************/
  1055. X
  1056. X
  1057. X/************************************************************************/
  1058. X/*                                    */
  1059. X/*    misc:    miscellaneous support routines for contool        */
  1060. X/*                                    */
  1061. X/************************************************************************/
  1062. X
  1063. X#include    <stdio.h>
  1064. X#include    <ctype.h>
  1065. X
  1066. X/************************************************************************/
  1067. X/*                                    */
  1068. X/*    getline        read a line from a stream, removing the newline    */
  1069. X/*            and returning the length of the line.        */
  1070. X/*                                    */
  1071. X/************************************************************************/
  1072. X
  1073. Xint    getline(stream, string, max)
  1074. X
  1075. XFILE    *stream;
  1076. Xchar    *string;
  1077. Xint    max;
  1078. X
  1079. X{    register    int    i, j;
  1080. X
  1081. X    i = (int) fgets(string, max, stream);
  1082. X    if (i == NULL)
  1083. X       return(EOF);
  1084. X    j = strlen(string);
  1085. X    if (j > 0 && string[j - 1] == '\n')
  1086. X       string[--j] = '\0';
  1087. X    return(j);
  1088. X}
  1089. X
  1090. X/************************************************************************/
  1091. X/*                                    */
  1092. X/*    getopt        extract options and their parameters from a    */
  1093. X/*            list of strings (most likely the command line    */
  1094. X/*            arguments.                    */
  1095. X/*                                    */
  1096. X/*            The 'opts' descriptor is a string of letters,    */
  1097. X/*            indicating which options are valid.  If a    */
  1098. X/*            letter is followed by a ':', that option is    */
  1099. X/*            assumed to have a parameter following it.    */
  1100. X/*            Getopt returns the discovered option, NULL when    */
  1101. X/*            an illegal option is found, and EOF when no    */
  1102. X/*            more options are found.  Options and their    */
  1103. X/*            parameters are removed from the string list.    */
  1104. X/*                                    */
  1105. X/************************************************************************/
  1106. X
  1107. Xstatic    delarg(argc, argv)
  1108. X
  1109. Xint    *argc;
  1110. Xchar    **argv;
  1111. X
  1112. X{    char    *p;
  1113. X
  1114. X    while (*argv = *(argv+1))
  1115. X       argv++;
  1116. X    (*argc)--;
  1117. X}
  1118. X
  1119. Xchar    getopt(argc, argv, opts, parm)
  1120. X
  1121. Xint    *argc;
  1122. Xchar    **argv;
  1123. Xchar    *opts;
  1124. Xchar    **parm;
  1125. X
  1126. X{    char    c, *p, *strcpy(), *index();
  1127. X    int    killed;
  1128. X
  1129. X    *parm = NULL;
  1130. X    while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  1131. X       argv++;
  1132. X    if (*argv == NULL)
  1133. X       return(EOF);
  1134. X    c = *(*argv+1);
  1135. X    *++(*argv) = '-';
  1136. X    if (killed = (*(*argv+1) == '\0'))
  1137. X       delarg(argc, argv);
  1138. X    if ((p = index(opts, c)) == NULL)
  1139. X       c = '\0';
  1140. X    else if (*(p+1) == ':') {
  1141. X       *parm = killed ? *argv : *argv+1;
  1142. X       delarg(argc, argv);
  1143. X       }
  1144. X    return(c);
  1145. X}
  1146. X
  1147. X/************************************************************************/
  1148. X/*                                    */
  1149. X/*    lower        convert a string to lower case            */
  1150. X/*                                    */
  1151. X/************************************************************************/
  1152. X
  1153. Xchar    *lower(s)
  1154. X
  1155. Xchar    *s;
  1156. X
  1157. X{    char    *p;
  1158. X
  1159. X    p = s;
  1160. X    while (*s) {
  1161. X       if (isupper(*s))
  1162. X          *s = tolower(*s);
  1163. X       s++;
  1164. X       }
  1165. X    return(p);
  1166. X}
  1167. X
  1168. X/************************************************************************/
  1169. X/*                                    */
  1170. X/*    verify(source, valid)                        */
  1171. X/*                                    */
  1172. X/*    char    *source;                        */
  1173. X/*    char    *valid;                            */
  1174. X/*                                    */
  1175. X/*    This routine verifies that every character in source is also in    */
  1176. X/*    valid.                                */
  1177. X/*                                    */
  1178. X/************************************************************************/
  1179. X
  1180. Xverify(source, valid)
  1181. X
  1182. Xchar    *source;
  1183. Xchar    *valid;
  1184. X
  1185. X{    register    char    *s;
  1186. X
  1187. X    for ( ; *source; source++) {
  1188. X       for (s = valid; *s && *s != *source; s++)
  1189. X          ;
  1190. X       if (*s == '\0')
  1191. X          return(0);
  1192. X       }
  1193. X    return(1);
  1194. X}
  1195. X
  1196. X/************************************************************************/
  1197. X/*                                    */
  1198. X/*    saveargs    Replicate and return a pointer to the argument    */
  1199. X/*            list passed in.                    */
  1200. X/*                                    */
  1201. X/************************************************************************/
  1202. X
  1203. Xchar    **saveargs(argc, argv)
  1204. X
  1205. Xint    argc;
  1206. Xchar    **argv;
  1207. X
  1208. X{    int    i;
  1209. X    char    **copy;
  1210. X
  1211. X    copy = (char **) malloc((argc + 1) * sizeof(char *));
  1212. X    for (i = 0; i < argc; i++)
  1213. X       strcpy(copy[i] = (char *) malloc(strlen(argv[i]) + 1), argv[i]);
  1214. X    copy[i] = (char *) 0;
  1215. X    return(copy);
  1216. X}
  1217. X
  1218. X/************************************************************************/
  1219. X/*                                    */
  1220. X/*    tokenize    break a line into tokens            */
  1221. X/*                                    */
  1222. X/************************************************************************/
  1223. X
  1224. Xtokenize(line, argc, argv, max)
  1225. X
  1226. Xchar    *line;
  1227. Xint    *argc;
  1228. Xchar    *argv[];
  1229. Xint    max;
  1230. X
  1231. X{    char    *buf, match;
  1232. X
  1233. X    *argc = 0;
  1234. X    buf = (char *) malloc(strlen(line) * 2 + 1);
  1235. X    while (*line && (*argc < (max-1))) {
  1236. X       while (isspace(*line))
  1237. X          line++;
  1238. X       argv[(*argc)++] = buf;
  1239. X       switch (*line) {
  1240. X          case '"'  :
  1241. X          case '\'' : match = *line++; /* remove the quote mark */
  1242. X                    while (*line && (*line != match))
  1243. X                       *buf++ = *line++;
  1244. X                    if (*line)
  1245. X                       line++; /* wipe out quote mark */
  1246. X                    break;
  1247. X          default   : while (*line && !isspace(*line) && (*line != '"') && (*line != '\''))
  1248. X                       *buf++ = *line++;
  1249. X                    break;
  1250. X          }
  1251. X       *buf++ = '\0';
  1252. X       }
  1253. X    *buf = '\0';
  1254. X    argv[*argc] = (char *) 0;
  1255. X}
  1256. X
  1257. X/************************************************************************/
  1258. X/*                                    */
  1259. X/*    open_psuedo_tty    opens the first available psuedo terminal    */
  1260. X/*                                    */
  1261. X/************************************************************************/
  1262. X
  1263. X#define        P_POS        5
  1264. X#define        L_POS        8
  1265. X#define        D_POS        9
  1266. X
  1267. X#define        PATH        "/dev/ptyp0"
  1268. X#define        LETTERS        "pqr"
  1269. X#define        DIGITS        "0123456789abcdef"
  1270. X
  1271. Xstatic    char    path[12];
  1272. X
  1273. Xchar    *open_psuedo_tty(master, m_mode, slave, s_mode)
  1274. X
  1275. XFILE    **master;
  1276. Xchar    *m_mode;
  1277. XFILE    **slave;
  1278. Xchar    *s_mode;
  1279. X
  1280. X{    char    *s, *t;
  1281. X
  1282. X    strcpy(path, PATH);
  1283. X    for (s = LETTERS; *s && *master == NULL; s++) {
  1284. X       path[L_POS] = *s;
  1285. X       for (t = DIGITS; *t && *master == NULL; t++) {
  1286. X          path[D_POS] = *t;
  1287. X          *master = fopen(path, m_mode);
  1288. X          }
  1289. X       }
  1290. X    if (*master != NULL) {
  1291. X       path[P_POS] = 't';
  1292. X       *slave = fopen(path, s_mode);
  1293. X       path[P_POS] = 'p';
  1294. X       }
  1295. X    return(path);
  1296. X}
  1297. END_OF_FILE
  1298. if test 6517 -ne `wc -c <'misc.c'`; then
  1299.     echo shar: \"'misc.c'\" unpacked with wrong size!
  1300. fi
  1301. # end of 'misc.c'
  1302. fi
  1303. if test -f 'sample.filter' -a "${1}" != "-c" ; then 
  1304.   echo shar: Will not clobber existing file \"'sample.filter'\"
  1305. else
  1306. echo shar: Extracting \"'sample.filter'\" \(480 characters\)
  1307. sed "s/^X//" >'sample.filter' <<'END_OF_FILE'
  1308. X# quietly retain chuck going su:
  1309. XQUIET    'SU: chuck'
  1310. X
  1311. X# ignore Frame Maker coming up:
  1312. XIGNORE    'maker: Starting Frame Maker' TO 'maker: finished loading'
  1313. X
  1314. X# ignore Frame Writer coming up:
  1315. XIGNORE    'writer: Starting Frame Writer' TO 'writer: finished loading'
  1316. X
  1317. X# ignore window data lock messages
  1318. XIGNORE    'Window data lock' TO 'The offending process'
  1319. X
  1320. X# retain some window messages
  1321. XQUIET    'WIN ioctl number'
  1322. X
  1323. X# retain another crazy window system message
  1324. XQUIET    'A tty window' TO 'Its child'
  1325. END_OF_FILE
  1326. if test 480 -ne `wc -c <'sample.filter'`; then
  1327.     echo shar: \"'sample.filter'\" unpacked with wrong size!
  1328. fi
  1329. # end of 'sample.filter'
  1330. fi
  1331. if test ! -d 'icons' ; then
  1332.     echo shar: Creating directory \"'icons'\"
  1333.     mkdir 'icons'
  1334. fi
  1335. if test -f 'icons/console1.icon' -a "${1}" != "-c" ; then 
  1336.   echo shar: Will not clobber existing file \"'icons/console1.icon'\"
  1337. else
  1338. echo shar: Extracting \"'icons/console1.icon'\" \(1933 characters\)
  1339. sed "s/^X//" >'icons/console1.icon' <<'END_OF_FILE'
  1340. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1341. X */
  1342. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1343. X    0x0003,0xFFFF,0xFFFF,0xF800,0x0004,0x0000,0x0000,0x0600,
  1344. X    0x0004,0x7FFF,0xFFFF,0xC500,0x0004,0x8000,0x0000,0x2480,
  1345. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0000,0x0000,0x1440,
  1346. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0718,0xA000,0x1440,
  1347. X    0x0005,0x0824,0xD000,0x1440,0x0005,0x0824,0x93C0,0x1440,
  1348. X    0x0005,0x0824,0x9000,0x1440,0x0005,0x0718,0x9000,0x1440,
  1349. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0000,0x0000,0x1440,
  1350. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0000,0x0000,0x1440,
  1351. X    0x0005,0x0000,0x0180,0x1440,0x0005,0x001C,0x6086,0x1440,
  1352. X    0x0005,0x0020,0x9089,0x1440,0x0005,0x0018,0x908E,0x1440,
  1353. X    0x0005,0x0004,0x9088,0x1440,0x0005,0x0038,0x6087,0x1440,
  1354. X    0x0005,0x0000,0x0000,0x1480,0x0005,0x0000,0x0000,0x1480,
  1355. X    0x0005,0x0000,0x0000,0x1500,0x0005,0x0000,0x0000,0x1500,
  1356. X    0x001C,0x8000,0x0000,0x2600,0x0064,0x7FFF,0xFFFF,0xC600,
  1357. X    0x0084,0x0000,0x0000,0x0400,0x0103,0xFFFF,0xFFFF,0xF800,
  1358. X    0x0200,0x0004,0x0100,0x0000,0x0400,0x0004,0x0100,0x0000,
  1359. X    0x080F,0xFFF8,0x00FF,0xFFE0,0x081F,0xFFF8,0x00FF,0xFFD0,
  1360. X    0x081F,0xFFFC,0x01FF,0xFFD0,0x083F,0xFFFF,0xFFFF,0xFFA0,
  1361. X    0x083F,0xFFFF,0xFFFF,0xFFA0,0x0820,0x0000,0x0000,0x0040,
  1362. X    0x0820,0x0000,0x0000,0x0040,0x083F,0xFFFF,0xFFFF,0xFF80,
  1363. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1364. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1365. X    0x0800,0x0000,0x0000,0x0000,0x047F,0xFFFF,0xFFFF,0xFF00,
  1366. X    0x0380,0x0000,0x0000,0x0200,0x008A,0xAAAA,0xAAAA,0x8200,
  1367. X    0x0100,0x0000,0x0000,0x0400,0x0115,0x5555,0x5554,0x8400,
  1368. X    0x0200,0x0000,0x0001,0x0800,0x020D,0xFFFF,0xFFDB,0x0800,
  1369. X    0x0400,0x0000,0x0000,0x1000,0x07FF,0xFFFF,0xFFFF,0xF000,
  1370. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1371. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1372. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1373. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1374. END_OF_FILE
  1375. if test 1933 -ne `wc -c <'icons/console1.icon'`; then
  1376.     echo shar: \"'icons/console1.icon'\" unpacked with wrong size!
  1377. fi
  1378. # end of 'icons/console1.icon'
  1379. fi
  1380. if test -f 'icons/console1_bad.icon' -a "${1}" != "-c" ; then 
  1381.   echo shar: Will not clobber existing file \"'icons/console1_bad.icon'\"
  1382. else
  1383. echo shar: Extracting \"'icons/console1_bad.icon'\" \(1933 characters\)
  1384. sed "s/^X//" >'icons/console1_bad.icon' <<'END_OF_FILE'
  1385. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1386. X */
  1387. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1388. X    0x0003,0xFFFF,0xFFFF,0xF800,0x0004,0x0000,0x0000,0x0600,
  1389. X    0x0004,0x7FFF,0xFFFF,0xC500,0x0004,0x8000,0x0000,0x2480,
  1390. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0000,0x0000,0x1440,
  1391. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x00A1,0x8880,0x1440,
  1392. X    0x0005,0x00D2,0x4880,0x1440,0x0005,0x0093,0x8A80,0x1440,
  1393. X    0x0005,0x0092,0x0A80,0x1440,0x0005,0x0091,0xC500,0x1440,
  1394. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0000,0x0000,0x1440,
  1395. X    0x0005,0x0000,0x0000,0x1440,0x0005,0x0347,0x1C70,0x1440,
  1396. X    0x0005,0x02A8,0x2480,0x1440,0x0005,0x02A6,0x2460,0x1440,
  1397. X    0x0005,0x02A1,0x1C10,0x1440,0x0005,0x02AE,0x04E0,0x1440,
  1398. X    0x0005,0x0000,0x3800,0x1440,0x0005,0x0000,0x0000,0x1440,
  1399. X    0x0005,0x0000,0x0000,0x1480,0x0005,0x0000,0x0000,0x1480,
  1400. X    0x0005,0x0000,0x0000,0x1500,0x0005,0x0000,0x0000,0x1500,
  1401. X    0x001C,0x8000,0x0000,0x2600,0x0064,0x7FFF,0xFFFF,0xC600,
  1402. X    0x0084,0x0000,0x0000,0x0400,0x0103,0xFFFF,0xFFFF,0xF800,
  1403. X    0x0200,0x0004,0x0100,0x0000,0x0400,0x0004,0x0100,0x0000,
  1404. X    0x080F,0xFFF8,0x00FF,0xFFE0,0x081F,0xFFF8,0x00FF,0xFFD0,
  1405. X    0x081F,0xFFFC,0x01FF,0xFFD0,0x083F,0xFFFF,0xFFFF,0xFFA0,
  1406. X    0x083F,0xFFFF,0xFFFF,0xFFA0,0x0820,0x0000,0x0000,0x0040,
  1407. X    0x0820,0x0000,0x0000,0x0040,0x083F,0xFFFF,0xFFFF,0xFF80,
  1408. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1409. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1410. X    0x0800,0x0000,0x0000,0x0000,0x047F,0xFFFF,0xFFFF,0xFF00,
  1411. X    0x0380,0x0000,0x0000,0x0200,0x008A,0xAAAA,0xAAAA,0x8200,
  1412. X    0x0100,0x0000,0x0000,0x0400,0x0115,0x5555,0x5554,0x8400,
  1413. X    0x0200,0x0000,0x0001,0x0800,0x020D,0xFFFF,0xFFDB,0x0800,
  1414. X    0x0400,0x0000,0x0000,0x1000,0x07FF,0xFFFF,0xFFFF,0xF000,
  1415. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1416. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1417. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1418. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1419. END_OF_FILE
  1420. if test 1933 -ne `wc -c <'icons/console1_bad.icon'`; then
  1421.     echo shar: \"'icons/console1_bad.icon'\" unpacked with wrong size!
  1422. fi
  1423. # end of 'icons/console1_bad.icon'
  1424. fi
  1425. if test -f 'icons/console1_flash.icon' -a "${1}" != "-c" ; then 
  1426.   echo shar: Will not clobber existing file \"'icons/console1_flash.icon'\"
  1427. else
  1428. echo shar: Extracting \"'icons/console1_flash.icon'\" \(1933 characters\)
  1429. sed "s/^X//" >'icons/console1_flash.icon' <<'END_OF_FILE'
  1430. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1431. X */
  1432. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1433. X    0x0003,0xFFFF,0xFFFF,0xF800,0x0004,0x0000,0x0000,0x0600,
  1434. X    0x0004,0x7FFF,0xFFFF,0xC500,0x0004,0xFFFF,0xFFFF,0xE480,
  1435. X    0x0005,0xFFFF,0xFFFF,0xF440,0x0005,0xFFFF,0xFFFF,0xF440,
  1436. X    0x0005,0xFFFF,0xFFFF,0xF440,0x0005,0xFF5E,0x777F,0xF440,
  1437. X    0x0005,0xFF2D,0xB77F,0xF440,0x0005,0xFF6C,0x757F,0xF440,
  1438. X    0x0005,0xFF6D,0xF57F,0xF440,0x0005,0xFF6E,0x3AFF,0xF440,
  1439. X    0x0005,0xFFFF,0xFFFF,0xF440,0x0005,0xFFFF,0xFFFF,0xF440,
  1440. X    0x0005,0xFFFF,0xFFFF,0xF440,0x0005,0xFCB8,0xE38F,0xF440,
  1441. X    0x0005,0xFD57,0xDB7F,0xF440,0x0005,0xFD59,0xDB9F,0xF440,
  1442. X    0x0005,0xFD5E,0xE3EF,0xF440,0x0005,0xFD51,0xFB1F,0xF440,
  1443. X    0x0005,0xFFFF,0xC7FF,0xF440,0x0005,0xFFFF,0xFFFF,0xF440,
  1444. X    0x0005,0xFFFF,0xFFFF,0xF480,0x0005,0xFFFF,0xFFFF,0xF480,
  1445. X    0x0005,0xFFFF,0xFFFF,0xF500,0x0005,0xFFFF,0xFFFF,0xF500,
  1446. X    0x001C,0xFFFF,0xFFFF,0xE600,0x0064,0x7FFF,0xFFFF,0xC600,
  1447. X    0x0084,0x0000,0x0000,0x0400,0x0103,0xFFFF,0xFFFF,0xF800,
  1448. X    0x0200,0x0004,0x0100,0x0000,0x0400,0x0004,0x0100,0x0000,
  1449. X    0x080F,0xFFF8,0x00FF,0xFFE0,0x081F,0xFFF8,0x00FF,0xFFD0,
  1450. X    0x081F,0xFFFC,0x01FF,0xFFD0,0x083F,0xFFFF,0xFFFF,0xFFA0,
  1451. X    0x083F,0xFFFF,0xFFFF,0xFFA0,0x0820,0x0000,0x0000,0x0040,
  1452. X    0x0820,0x0000,0x0000,0x0040,0x083F,0xFFFF,0xFFFF,0xFF80,
  1453. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1454. X    0x0800,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0000,
  1455. X    0x0800,0x0000,0x0000,0x0000,0x047F,0xFFFF,0xFFFF,0xFF00,
  1456. X    0x0380,0x0000,0x0000,0x0200,0x008A,0xAAAA,0xAAAA,0x8200,
  1457. X    0x0100,0x0000,0x0000,0x0400,0x0115,0x5555,0x5554,0x8400,
  1458. X    0x0200,0x0000,0x0001,0x0800,0x020D,0xFFFF,0xFFDB,0x0800,
  1459. X    0x0400,0x0000,0x0000,0x1000,0x07FF,0xFFFF,0xFFFF,0xF000,
  1460. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1461. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1462. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1463. X    0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  1464. END_OF_FILE
  1465. if test 1933 -ne `wc -c <'icons/console1_flash.icon'`; then
  1466.     echo shar: \"'icons/console1_flash.icon'\" unpacked with wrong size!
  1467. fi
  1468. # end of 'icons/console1_flash.icon'
  1469. fi
  1470. if test -f 'icons/contool.icon' -a "${1}" != "-c" ; then 
  1471.   echo shar: Will not clobber existing file \"'icons/contool.icon'\"
  1472. else
  1473. echo shar: Extracting \"'icons/contool.icon'\" \(1933 characters\)
  1474. sed "s/^X//" >'icons/contool.icon' <<'END_OF_FILE'
  1475. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1476. X */
  1477. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1478. X    0x8003,0xFFFF,0xFFFF,0xF801,0x8004,0x0000,0x0000,0x0601,
  1479. X    0x8004,0x7FFF,0xFFFF,0xC501,0x8004,0x8000,0x0000,0x2481,
  1480. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x3E80,0x0000,0x1441,
  1481. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1482. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1483. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1484. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1485. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1486. X    0x8005,0x0000,0x0000,0x1441,0x8005,0x0000,0x0000,0x1441,
  1487. X    0x8005,0x0000,0x0000,0x1481,0x8005,0x0000,0x0000,0x1481,
  1488. X    0x8005,0x0000,0x0000,0x1501,0x8005,0x0000,0x0000,0x1501,
  1489. X    0x801C,0x8000,0x0000,0x2601,0x8064,0x7FFF,0xFFFF,0xC601,
  1490. X    0x8084,0x0000,0x0000,0x0401,0x8103,0xFFFF,0xFFFF,0xF801,
  1491. X    0x8200,0x0004,0x0100,0x0001,0x8400,0x0004,0x0100,0x0001,
  1492. X    0x880F,0xFFF8,0x00FF,0xFFE1,0x881F,0xFFF8,0x00FF,0xFFE1,
  1493. X    0x881F,0xFFFC,0x01FF,0xFFE1,0x883F,0xFFFF,0xFFFF,0xFFE1,
  1494. X    0x883F,0xFFFF,0xFFFF,0xFFE1,0x8820,0x0000,0x0000,0x00E1,
  1495. X    0x8820,0x0000,0x0000,0x00C1,0x847F,0xFFFF,0xFFFF,0xFFC1,
  1496. X    0x8380,0x0000,0x0000,0x0381,0x808A,0xAAAA,0xAAAA,0x8301,
  1497. X    0x8100,0x0000,0x0000,0x0501,0x8115,0x5555,0x5554,0x8501,
  1498. X    0x8200,0x0000,0x0001,0x0A01,0x820D,0xFFFF,0xFFDB,0x0A01,
  1499. X    0x8400,0x0000,0x0000,0x1401,0x87FF,0xFFFF,0xFFFF,0xF401,
  1500. X    0x8400,0x0000,0x0000,0x0801,0x87FF,0xFFFF,0xFFFF,0xF801,
  1501. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1502. X    0x8F80,0x0000,0x0001,0xE001,0x98C0,0x0000,0x0000,0x6001,
  1503. X    0x98C0,0x0000,0x0000,0x6001,0x9807,0xC5E1,0xF0F8,0x61F1,
  1504. X    0x980C,0x6733,0x198C,0x6319,0x980C,0x6633,0x018C,0x6319,
  1505. X    0x980C,0x6631,0xF18C,0x63F9,0x98CC,0x6630,0x198C,0x6301,
  1506. X    0x98CC,0x6633,0x198C,0x6319,0x8F87,0xC631,0xF0F8,0x61F1,
  1507. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1508. X    0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1509. END_OF_FILE
  1510. if test 1933 -ne `wc -c <'icons/contool.icon'`; then
  1511.     echo shar: \"'icons/contool.icon'\" unpacked with wrong size!
  1512. fi
  1513. # end of 'icons/contool.icon'
  1514. fi
  1515. if test -f 'icons/contool_bad.icon' -a "${1}" != "-c" ; then 
  1516.   echo shar: Will not clobber existing file \"'icons/contool_bad.icon'\"
  1517. else
  1518. echo shar: Extracting \"'icons/contool_bad.icon'\" \(1933 characters\)
  1519. sed "s/^X//" >'icons/contool_bad.icon' <<'END_OF_FILE'
  1520. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1521. X */
  1522. X    0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
  1523. X    0x8003,0xFFFF,0xFFFF,0xF801,0x8004,0x0000,0x0000,0x0601,
  1524. X    0x8004,0x7FFF,0xFFFF,0xC501,0x8004,0x8000,0x0000,0x2481,
  1525. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x417F,0xFFFF,0xD441,
  1526. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1527. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1528. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1529. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1530. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1531. X    0x8005,0x7FFF,0xFFFF,0xD441,0x8005,0x7FFF,0xFFFF,0xD441,
  1532. X    0x8005,0x7FFF,0xFFFF,0xD481,0x8005,0x7FFF,0xFFFF,0xD481,
  1533. X    0x8005,0x7FFF,0xFFFF,0xD501,0x8005,0x7FFF,0xFFFF,0xD501,
  1534. X    0x801C,0x8000,0x0000,0x2601,0x8064,0x7FFF,0xFFFF,0xC601,
  1535. X    0x8084,0x0000,0x0000,0x0401,0x8103,0xFFFF,0xFFFF,0xF801,
  1536. X    0x8200,0x0004,0x0100,0x0001,0x8400,0x0004,0x0100,0x0001,
  1537. X    0x880F,0xFFF8,0x00FF,0xFFE1,0x881F,0xFFF8,0x00FF,0xFFE1,
  1538. X    0x881F,0xFFFC,0x01FF,0xFFE1,0x883F,0xFFFF,0xFFFF,0xFFE1,
  1539. X    0x883F,0xFFFF,0xFFFF,0xFFE1,0x8820,0x0000,0x0000,0x00E1,
  1540. X    0x8820,0x0000,0x0000,0x00C1,0x847F,0xFFFF,0xFFFF,0xFFC1,
  1541. X    0x8380,0x0000,0x0000,0x0381,0x808A,0xAAAA,0xAAAA,0x8301,
  1542. X    0x8100,0x0000,0x0000,0x0501,0x8115,0x5555,0x5554,0x8501,
  1543. X    0x8200,0x0000,0x0001,0x0A01,0x820D,0xFFFF,0xFFDB,0x0A01,
  1544. X    0x8400,0x0000,0x0000,0x1401,0x87FF,0xFFFF,0xFFFF,0xF401,
  1545. X    0x8400,0x0000,0x0000,0x0801,0x87FF,0xFFFF,0xFFFF,0xF801,
  1546. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1547. X    0x8F80,0x0000,0x0001,0xE001,0x98C0,0x0000,0x0000,0x6001,
  1548. X    0x98C0,0x0000,0x0000,0x6001,0x9807,0xC5E1,0xF0F8,0x61F1,
  1549. X    0x980C,0x6733,0x198C,0x6319,0x980C,0x6633,0x018C,0x6319,
  1550. X    0x980C,0x6631,0xF18C,0x63F9,0x98CC,0x6630,0x198C,0x6301,
  1551. X    0x98CC,0x6633,0x198C,0x6319,0x8F87,0xC631,0xF0F8,0x61F1,
  1552. X    0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
  1553. X    0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
  1554. END_OF_FILE
  1555. if test 1933 -ne `wc -c <'icons/contool_bad.icon'`; then
  1556.     echo shar: \"'icons/contool_bad.icon'\" unpacked with wrong size!
  1557. fi
  1558. # end of 'icons/contool_bad.icon'
  1559. fi
  1560. if test -f 'icons/stopsign.icon' -a "${1}" != "-c" ; then 
  1561.   echo shar: Will not clobber existing file \"'icons/stopsign.icon'\"
  1562. else
  1563. echo shar: Extracting \"'icons/stopsign.icon'\" \(1933 characters\)
  1564. sed "s/^X//" >'icons/stopsign.icon' <<'END_OF_FILE'
  1565. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1566. X */
  1567. X    0x8888,0xBFFF,0xFFFC,0x8888,0x8888,0xC000,0x0002,0x8888,
  1568. X    0x2222,0x8000,0x0001,0x2222,0x2223,0x0FFF,0xFFF0,0xA222,
  1569. X    0x888A,0x1FFF,0xFFF8,0x4888,0x888C,0x3FFF,0xFFFC,0x2888,
  1570. X    0x2228,0x7FFF,0xFFFE,0x1222,0x2230,0xFFFF,0xFFFF,0x0A22,
  1571. X    0x88A1,0xFFFF,0xFFFF,0x8488,0x8843,0xFFFF,0xFFFF,0xC288,
  1572. X    0x2287,0xFFFF,0xFFFF,0xE122,0x230F,0xFFFF,0xFFFF,0xF0A2,
  1573. X    0x8A1F,0xFFFF,0xFFFF,0xF848,0x8C3F,0xFFFF,0xFFFF,0xFC28,
  1574. X    0x287F,0xFFFF,0xFFFF,0xFE12,0x30FF,0xFFFF,0xFFFF,0xFF0A,
  1575. X    0xA1FF,0xFFFF,0xFFFF,0xFF84,0xC3FF,0xFFFF,0xFFFF,0xFFC2,
  1576. X    0x87FF,0xFFFF,0xFFFF,0xFFE1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1577. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1578. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1579. X    0x8FF0,0x0C00,0xF87C,0x03F1,0x8FE7,0xCDCE,0xF73E,0x79F1,
  1580. X    0x8FCF,0xEFCF,0xEF9E,0x7CF1,0x8FCF,0xEFCF,0xEFCE,0x7CF1,
  1581. X    0x8FC7,0xFFCF,0xCFCE,0x7CF1,0x8FE1,0xFFCF,0xCFCE,0x79F1,
  1582. X    0x8FF0,0xFFCF,0xCFCE,0x03F1,0x8FFC,0x3FCF,0xCFCE,0x7FF1,
  1583. X    0x8FFF,0x1FCF,0xCFCE,0x7FF1,0x8FFF,0x8FCF,0xCFCE,0x7FF1,
  1584. X    0x8FDF,0xCFCF,0xEFCE,0x7FF1,0x8FDF,0xCFCF,0xE7DE,0x7FF1,
  1585. X    0x8FCF,0x9FCF,0xF3BE,0x7FF1,0x8FC0,0x3F03,0xF87C,0x3FF1,
  1586. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1587. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1588. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x8FFF,0xFFFF,0xFFFF,0xFFF1,
  1589. X    0x8FFF,0xFFFF,0xFFFF,0xFFF1,0x87FF,0xFFFF,0xFFFF,0xFFE1,
  1590. X    0x43FF,0xFFFF,0xFFFF,0xFFC2,0x21FF,0xFFFF,0xFFFF,0xFF86,
  1591. X    0x90FF,0xFFFF,0xFFFF,0xFF08,0x887F,0xFFFF,0xFFFF,0xFE18,
  1592. X    0x243F,0xFFFF,0xFFFF,0xFC22,0x221F,0xFFFF,0xFFFF,0xF862,
  1593. X    0x890F,0xFFFF,0xFFFF,0xF088,0x8887,0xFFFF,0xFFFF,0xE188,
  1594. X    0x2243,0xFFFF,0xFFFF,0xC222,0x2221,0xFFFF,0xFFFF,0x8622,
  1595. X    0x8890,0xFFFF,0xFFFF,0x0888,0x8888,0x7FFF,0xFFFE,0x1888,
  1596. X    0x2224,0x3FFF,0xFFFC,0x2222,0x2222,0x1FFF,0xFFF8,0x6222,
  1597. X    0x8889,0x0FFF,0xFFF0,0x8888,0x8888,0x8000,0x0001,0x8888,
  1598. X    0x2222,0x4000,0x0002,0x2222,0x2222,0x3FFF,0xFFFE,0x2222
  1599. END_OF_FILE
  1600. if test 1933 -ne `wc -c <'icons/stopsign.icon'`; then
  1601.     echo shar: \"'icons/stopsign.icon'\" unpacked with wrong size!
  1602. fi
  1603. # end of 'icons/stopsign.icon'
  1604. fi
  1605. if test -f 'icons/stopsign_inv.icon' -a "${1}" != "-c" ; then 
  1606.   echo shar: Will not clobber existing file \"'icons/stopsign_inv.icon'\"
  1607. else
  1608. echo shar: Extracting \"'icons/stopsign_inv.icon'\" \(1933 characters\)
  1609. sed "s/^X//" >'icons/stopsign_inv.icon' <<'END_OF_FILE'
  1610. X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
  1611. X */
  1612. X    0x8888,0x8888,0x8888,0x8888,0x8888,0xBFFF,0xFFFC,0x8888,
  1613. X    0x2222,0x7FFF,0xFFFE,0x2222,0x2222,0xFFFF,0xFFFF,0x2222,
  1614. X    0x8889,0xE000,0x0007,0x8888,0x888B,0xC000,0x0003,0xC888,
  1615. X    0x2227,0x8000,0x0001,0xE222,0x222F,0x0000,0x0000,0xF222,
  1616. X    0x889E,0x0000,0x0000,0x7888,0x88BC,0x0000,0x0000,0x3C88,
  1617. X    0x2278,0x0000,0x0000,0x1E22,0x22F0,0x0000,0x0000,0x0F22,
  1618. X    0x89E0,0x0000,0x0000,0x0788,0x8BC0,0x0000,0x0000,0x03C8,
  1619. X    0x2780,0x0000,0x0000,0x01E2,0x2F00,0x0000,0x0000,0x00F2,
  1620. X    0x9E00,0x0000,0x0000,0x0078,0xBC00,0x0000,0x0000,0x003C,
  1621. X    0x7800,0x0000,0x0000,0x001E,0x7000,0x0000,0x0000,0x000E,
  1622. X    0xF000,0x0000,0x0000,0x000E,0xF000,0x0000,0x0000,0x000E,
  1623. X    0x7000,0x0000,0x0000,0x000E,0x7000,0x0000,0x0000,0x000E,
  1624. X    0xF00F,0xF3FF,0x0783,0xFC0E,0xF018,0x3231,0x08C1,0x860E,
  1625. X    0x7030,0x1030,0x1061,0x830E,0x7030,0x1030,0x1031,0x830E,
  1626. X    0xF038,0x0030,0x3031,0x830E,0xF01E,0x0030,0x3031,0x860E,
  1627. X    0x700F,0x0030,0x3031,0xFC0E,0x7003,0xC030,0x3031,0x800E,
  1628. X    0xF000,0xE030,0x3031,0x800E,0xF000,0x7030,0x3031,0x800E,
  1629. X    0x7020,0x3030,0x1031,0x800E,0x7020,0x3030,0x1821,0x800E,
  1630. X    0xF030,0x6030,0x0C41,0x800E,0xF03F,0xC0FC,0x0783,0xC00E,
  1631. X    0x7000,0x0000,0x0000,0x000E,0x7000,0x0000,0x0000,0x000E,
  1632. X    0xF000,0x0000,0x0000,0x000E,0xF000,0x0000,0x0000,0x000E,
  1633. X    0x7000,0x0000,0x0000,0x000E,0x7000,0x0000,0x0000,0x000E,
  1634. X    0xF000,0x0000,0x0000,0x000E,0xF800,0x0000,0x0000,0x001E,
  1635. X    0x3C00,0x0000,0x0000,0x003E,0x3E00,0x0000,0x0000,0x007A,
  1636. X    0x8F00,0x0000,0x0000,0x00F8,0x8F80,0x0000,0x0000,0x01E8,
  1637. X    0x23C0,0x0000,0x0000,0x03E2,0x23E0,0x0000,0x0000,0x07A2,
  1638. X    0x88F0,0x0000,0x0000,0x0F88,0x88F8,0x0000,0x0000,0x1E88,
  1639. X    0x223C,0x0000,0x0000,0x3C22,0x223E,0x0000,0x0000,0x7822,
  1640. X    0x888F,0x0000,0x0000,0xF888,0x888F,0x8000,0x0001,0xE888,
  1641. X    0x2223,0xC000,0x0003,0xE222,0x2223,0xE000,0x0007,0xA222,
  1642. X    0x8888,0xFFFF,0xFFFF,0x8888,0x8888,0xFFFF,0xFFFE,0x8888,
  1643. X    0x2222,0x3FFF,0xFFFE,0x2222,0x2222,0x2222,0x2222,0x2222
  1644. END_OF_FILE
  1645. if test 1933 -ne `wc -c <'icons/stopsign_inv.icon'`; then
  1646.     echo shar: \"'icons/stopsign_inv.icon'\" unpacked with wrong size!
  1647. fi
  1648. # end of 'icons/stopsign_inv.icon'
  1649. fi
  1650. echo shar: End of shell archive.
  1651. exit 0
  1652.